package com.zack.designPattern.proxy.dynamicproxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class SpeakerInvocationHandler implements InvocationHandler {

	private Object proxiedObject;
	
	public SpeakerInvocationHandler(Object proxiedObject){
		this.proxiedObject = proxiedObject;
	}
	
	@Override
	public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
		System.out.println("from proxy");
		return method.invoke(proxiedObject, args);
	}

}
